@echo off
echo ===== 修复Mapper问题 =====
echo 此脚本将修复ActivityMapper和CreditRecordMapper的问题

echo 步骤1: 复制ActivityMapper.java文件...
if not exist ".\scms-secondclass\src\main\java\com\scms\secondclass\mapper\ActivityMapper.java" (
    echo 错误: 源文件不存在！
    exit /b 1
)

if not exist ".\scms-admin\src\main\java\com\scms\secondclass\mapper" (
    echo 创建目标目录...
    mkdir ".\scms-admin\src\main\java\com\scms\secondclass\mapper"
)

copy /Y ".\scms-secondclass\src\main\java\com\scms\secondclass\mapper\ActivityMapper.java" ".\scms-admin\src\main\java\com\scms\secondclass\mapper\ActivityMapper.java"
echo ActivityMapper.java文件复制完成！

echo 步骤2: 复制CreditRecordMapper.xml文件...
if not exist ".\scms-admin\src\main\resources\mapper\secondclass\CreditRecordMapper.xml" (
    echo 错误: 源文件不存在！
    exit /b 1
)

if not exist ".\scms-secondclass\src\main\resources\mapper\secondclass" (
    echo 创建目标目录...
    mkdir ".\scms-secondclass\src\main\resources\mapper\secondclass"
)

copy /Y ".\scms-admin\src\main\resources\mapper\secondclass\CreditRecordMapper.xml" ".\scms-secondclass\src\main\resources\mapper\secondclass\CreditRecordMapper.xml"
echo CreditRecordMapper.xml文件复制完成！

echo 步骤3: 清理和重新编译项目...
call mvn clean compile
echo 编译完成！

echo 步骤4: 启动系统...
cd scms-admin
java -jar target\scms-admin.jar 